' --------------------------------------------------
' 执行所有 case
' --------------------------------------------------
Private Sub test_All_Case()
  ' 基础 DataFrame
  test_addDataFrame
End Sub

' --------------------------------------------------
' 通用方法
' --------------------------------------------------
' 生成指定大小的 DataFrame
Private Function getStringDF(ByRef rsize As Long, ByRef csize As Integer) As IDataFrame
    Dim df As IDataFrame
    Dim realDF As DataFrame
    Set realDF = New DataFrame
    realDF.Init colCount:=csize, initRowSize:=rsize

    Set df = realDF
    df.appendEmptyRow rsize

    Dim ri As Long
    Dim ci As Integer
    For ri = 0 To rsize - 1
        For ci = 0 To csize - 1
            df.setDataByColIndex ri, ci, "c" & ri & ci
        Next
    Next

    Set getStringDF = df
End Function

' --------------------------------------------------
' 基础 DataFrame
' --------------------------------------------------
Private Sub test_addDataFrame()
    ' 创建一个 20 * 20 的数据表，表内的数据为: c<行索引><列索引>
    Dim df As IDataFrame
    Set df = getStringDF(20, 20)
    
    Dim shrw As SheetReaderWriter
    Set shrw = New SheetReaderWriter
    shrw.InitBySheetName ActiveWorkbook, "writeTest"


    ' 从第一行的第二列开始写入
    ' 标题背景为绿色
    shrw.addDataFrame 1, 2, df, needBorder:=True, titleBgColorNo:= UtilsContentFormat.COLOR_GREEN

End Sub

